package com.yoomiito.app.widget.dialog;

import android.content.Context;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;

import com.yoomiito.app.R;
import com.yoomiito.app.utils.wx.WXUtils;

public class ShareDialog extends BaseDialog implements View.OnClickListener {
    public ShareDialog(@NonNull Context context) {
        super(context,R.style.dialog_2);
    }

    public ShareDialog(@NonNull Context context, int themeResId) {
        super(context, themeResId);
    }

    protected ShareDialog(@NonNull Context context, boolean cancelable, @Nullable OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
    }

    @Override
    public View setView() {
        View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_wx_circle_share, null);
        view.findViewById(R.id.dialog_share_close).setOnClickListener(this);
        view.findViewById(R.id.dialog_share_open_wx).setOnClickListener(this);
        setWidthPercent(1);
        setmGravity(Gravity.BOTTOM);
        return view;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.dialog_share_close:
                dismiss();
                break;
            case R.id.dialog_share_open_wx:
                //打开微信
                WXUtils.INSTANCE.openWX(mContext);
                break;
        }
    }
}
